home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CBASE102.ARJ / BINST.BAT < prev    next >
DOS Batch File  |  1991-09-23  |  5KB  |  150 lines

  1. @echo off
  2. rem blkio installation batch file-----------------------------------------------
  3. rem binst.bat    1.5 - 91/09/23
  4.  
  5. rem ----------------------------------------------------------------------------
  6. rem NAME
  7. rem      install.bat - blkio library installation batch file for DOS
  8. rem
  9. rem SYNOPSIS
  10. rem      install model [x]
  11. rem
  12. rem DESCRIPTION
  13. rem     install.bat performs the installation of the blkio library for
  14. rem     DOS.  model specifies the memory model as one of the following.
  15. rem
  16. rem          S        small model
  17. rem          M        medium model
  18. rem          C        compact model
  19. rem          L        large model
  20. rem          H        huge model
  21. rem
  22. rem     The library file is named Mblkio.lib, where M would correspond
  23. rem     to the memory model of the library.
  24. rem
  25. rem     If specified, the second parameter causes the reference manual to
  26. rem     be extracted from the source code.  The reference manual is placed
  27. rem     in the file blkio.man.
  28. rem
  29. rem SEE ALSO
  30. rem      makefile
  31. rem
  32. rem NOTES
  33. rem      This batch file is written for use with Microsoft C.  To convert
  34. rem      it for use with another compiler, make the following
  35. rem      modifications:
  36. rem           1. Replace \usr\include with the include directory used by
  37. rem              the new compiler.
  38. rem           2. Replace \usr\lib with the library directory used by the
  39. rem              new compiler.
  40. rem           3. Replace cl with the command to invoke the compiler being
  41. rem              used, replacing the switches also, if necessary.  Below
  42. rem              are listed the Microsoft C switches used and their
  43. rem              meanings.
  44. rem                   -c        compile but don't link
  45. rem                   -Oalt     optimization
  46. rem                             a - relax alias checking
  47. rem                             l - enable loop optimization
  48. rem                             t - favor execution speed
  49. rem                   -Za       ANSI keywords only
  50. rem                   -A        memory model
  51. rem           4. The command to build the library archive from the object
  52. rem              modules may vary more drastically.  Microsoft C uses the
  53. rem              lib command with what is called a response file.  This
  54. rem              response file, blkio.rsp, contains a list of all the
  55. rem              object modules in the library.
  56. rem
  57. rem ----------------------------------------------------------------------------
  58.  
  59. rem verify arguments------------------------------------------------------------
  60. if "%1" == "S" goto arg1
  61. if "%1" == "M" goto arg1
  62. if "%1" == "C" goto arg1
  63. if "%1" == "L" goto arg1
  64. if "%1" == "H" goto arg1
  65. echo usage:  install model [x]
  66. echo Valid values for model are S (small), M (medium), C (compact),
  67. echo   L (large), and H (huge).  Model must be upper case.
  68. echo If x is specified, the reference manual will be extracted.
  69. goto end
  70. :arg1
  71.  
  72. if "%2" == "" goto arg2
  73. if "%2" == "x" goto arg2
  74. echo usage:  install model [x]
  75. echo Invalid second argument.  Valid value is lowercase x.
  76. goto end
  77. :arg2
  78.  
  79. if "%3" == "" goto arg3
  80. echo usage:  install model [x]
  81. echo Too many arguments specified.
  82. goto end
  83. :arg3
  84.  
  85. rem install boolean header file-------------------------------------------------
  86. rem
  87. if not exist \usr\include\bool.h goto bool
  88. echo \usr\include\bool.h exists.  ^C to exit, any other key to continue.
  89. pause
  90. :bool
  91. echo on
  92. copy bool.h \usr\include\bool.h
  93. @echo off
  94.  
  95. rem extract the reference manual------------------------------------------------
  96. if not "%2" == "x" goto skipman
  97. echo Extracting reference manual into blkio.man.
  98. if not exist blkio.man goto man
  99. echo blkio.man exists.  ^C to exit, any other key to continue.
  100. pause
  101. :man
  102. if not exist tmp goto tmp
  103. echo tmp exists.  ^C to exit, any other key to continue.
  104. pause
  105. :tmp
  106. echo on
  107. copy blkio.h/a+bclose.c+bcloseal.c+bexit.c+bflpop.c+bflpush.c+bflush.c tmp
  108. type tmp | manx -c > blkio.man
  109. copy bgetb.c/a+bgetbf.c+bgeth.c+bgethf.c+bopen.c+bputb.c+bputbf.c tmp
  110. type tmp | manx -c >> blkio.man
  111. copy bputh.c/a+bputhf.c+bsetbuf.c+bsetvbuf.c+bsync.c+lockb.c tmp
  112. type tmp | manx -c >> blkio.man
  113. del tmp
  114. @echo off
  115. :skipman
  116.  
  117. rem compile all blkio source files----------------------------------------------
  118. echo on
  119. cl -c -Oalt -Za -A%1 bclose.c   bcloseal.c bexit.c    bflpop.c   bflpush.c  bflush.c
  120. cl -c -Oalt -Za -A%1 bgetb.c    bgetbf.c   bgeth.c    bgethf.c   bopen.c    bputb.c
  121. cl -c -Oalt -Za -A%1 bputbf.c   bputh.c    bputhf.c   bsetbuf.c  bsetvbuf.c bsync.c    lockb.c
  122. cl -c -Oalt -Za -A%1 bops.c     buops.c
  123. @echo off
  124.  
  125. rem build the blkio library archive---------------------------------------------
  126. if exist %1blkio.lib del %1blkio.lib
  127. echo on
  128. lib %1blkio @blkio.rsp
  129. @echo off
  130.  
  131. rem install the blkio library---------------------------------------------------
  132. if not exist \usr\include\blkio.h goto h
  133. echo \usr\include\blkio.h exists.  ^C to exit, any other key to continue.
  134. pause
  135. :h
  136. echo on
  137. copy blkio.h \usr\include\blkio.h
  138. @echo off
  139.  
  140. if not exist \usr\lib\%1blkio.lib goto lib
  141. echo \usr\lib\%1blkio.lib exists.  ^C to exit, any other key to continue.
  142. pause
  143. :lib
  144. echo on
  145. copy %1blkio.lib \usr\lib\%1blkio.lib
  146. @echo off
  147.  
  148. rem end of blkio installation batch file----------------------------------------
  149. :end
  150.